package com.lyEducation.util;

import java.util.Random;
import java.util.UUID;

public class CodeUtil {
    //生成唯一的激活码
    public static String generateUniqueCode() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }

    public static String generateActiveCode() {
        StringBuffer stringBuffer = new StringBuffer();
        Random random = new Random();
        for (int i = 0; i < 5; i++) {
            stringBuffer.append(1 + random.nextInt(9));
        }
        return stringBuffer.toString();
    }
}
